package com.zhangshuo.patternDesign.factory.simpleFactory;

/**
 * Created by shuo.zhang on 2017-10-20.
 */
public class ProductFactory {

    public static IProduct getProduct(String type) {


        if ("A".equalsIgnoreCase(type)) {
            return new ProductA();
        }


        if ("B".equalsIgnoreCase(type)) {
            return new ProductB();
        }


        if (type == null) {
            return null;
        }

        return null;

    }
}
